"""
thread  ---> 线程
process ---> 进程
多进程
"""
import time
from multiprocessing import Process


def display(message):
    while True:
        print(message, end='', flush=True)
        time.sleep(0.01)


def main():
    Process(target=display, args=('Ping', ), daemon=True).start()
    Process(target=display, args=('Pong', ), daemon=True).start()
    Process(target=display, args=('Hello', ), daemon=True).start()
    Process(target=display, args=('Goodbye', ), daemon=True).start()
    time.sleep(5)


if __name__ == '__main__':
    main()
